export default {
    getCache(name){
        console.log(Object.prototype.toString.call(sessionStorage.getItem(name)) === '[object String]')
        if (Object.prototype.toString.call(sessionStorage.getItem(name)) === '[object String]'){
            return eval('(' + sessionStorage.getItem(name) + ')')
        }
        return sessionStorage.getItem(name);
    },
    setCache(name, data){
        if (Object.prototype.toString.call(data) === '[object Object]'){
            data = JSON.stringify(data)
        }
        sessionStorage.setItem(name, data)
    }
}